package com.example.jk.middlewares;

import com.example.jk.core.Context;
import com.example.jk.core.Log;
import com.example.jk.core.Middleware;
import com.example.jk.core.Next;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class LoggingMiddleware implements Middleware {
	@Override
	public void handle(Context context, Next next) {
		long non = System.nanoTime();
		Log.info("log start:{} ms", context);

		next.handle(context);

		Log.info("log end:{} ms", (System.nanoTime() - non) / 1000);

//    	Log.info("Request Path: " + context.requestPath + ", Method: " + context.method);
	}
}